package cn.xuewenbao.edu.controller;


import cn.xuewenbao.edu.entity.vo.GoodVo;
import cn.xuewenbao.edu.service.GoodLinkService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.api.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 好物链接表 前端控制器
 * </p>
 *
 * @author mafayu
 * @since 2021-06-04
 */
@RestController
@RequestMapping("/edu/goodlink")
@Api(tags = "好物推荐表")
public class GoodLinkController {

    @Autowired
    private GoodLinkService linkService;

    //根据用户id获得好物推荐列表-讲书
    @ApiOperation(value = "根据用户id获得好物推荐列表-讲书")
    @GetMapping("getGoodBookList/{userId}")
    public Result<List<GoodVo>> getGoodBookList(@PathVariable String userId) {
        Result<List<GoodVo>> result = linkService.getGoodBookList(userId);
        return result;
    }

    //根据用户id获得好物推荐列表-课程
    @ApiOperation(value = "根据用户id获得好物推荐列表-课程")
    @GetMapping("getGoodCourseList/{userId}")
    public Result<List<GoodVo>> getGoodCourseList(@PathVariable String userId) {
        Result<List<GoodVo>> result = linkService.getGoodCourseList(userId);
        return result;
    }
}

